//
//  FirstScroll.m
//  轮胎商城
//
//  Created by 张晋磊 on 2017/3/23.
//  Copyright © 2017年 张晋磊. All rights reserved.
//

#import "FirstScroll.h"

@interface FirstScroll ()<UIScrollViewDelegate>

@end

@implementation FirstScroll

-(instancetype)initWithFrame:(CGRect)frame{

    if(self = [super initWithFrame:frame]){
        
        self.pagingEnabled = YES;
    }
    return self;
}


-(void)setArrImg:(NSArray *)arrImg{

    _arrImg = arrImg;
    
    self.contentSize = CGSizeMake(_arrImg.count * self.frame.size.width, 200);
    
    for(int i=0;i<_arrImg.count;i++){
        
        UIImageView *img = [[UIImageView alloc]initWithFrame:CGRectMake(self.frame.size.width * i, 0, self.frame.size.width, self.frame.size.width)];
        
        img.contentMode = UIViewContentModeScaleAspectFill;
        
        img.image = [UIImage imageNamed:_arrImg[i]];
        
        [self addSubview:img];
    }
}
















@end
